package com.vol;

import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.vol.dao.SysUserDao;
import com.vol.entity.SysUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CeshiService {

    @Autowired
    private SysUserDao sysUserDao;


    public List<SysUser> getList(){
        return sysUserDao.list();
    }


    public boolean changepass(){
        String pass = MD5Util.encrypt("123456");

        LambdaUpdateWrapper<SysUser> updateWrapper = new LambdaUpdateWrapper<>();
        updateWrapper.eq(SysUser::getUsername,"admin666")
                .set(SysUser::getSbpwd,pass);
        boolean result = sysUserDao.update(updateWrapper);

        return result;
    }

}
